﻿using Autofac;
using Autofac.Integration.Mvc;

using HAL9006.Terminal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using System.Web.SessionState;

namespace HAL9006.Blog
{
    public class Global : Umbraco.Web.UmbracoApplication
    {
        protected override void OnApplicationStarted(object sender, EventArgs e)
        {
            base.OnApplicationStarted(sender, e);            

            var builder = new ContainerBuilder();

            //register all controllers found in this assembly
            builder.RegisterControllers(typeof(Global).Assembly);

            //add custom class to the container as Transient instance
            //builder.RegisterType<MyAwesomeContext>();
            builder.RegisterType<ThemeCommand>().As<ITerminalCommand>();

            var container = builder.Build();
            DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
        }
    }
}